#if UNITY_EDITOR
using System.IO;
using UnityEditor;
using UnityEngine;

public sealed class LubanToolBar : Editor
{
    [MenuItem("SrcFramework/Luban/Generate")]
    public static void GenerateLubanExcel()
    {
        string startPath = Directory.GetCurrentDirectory() + "\\Luban";
        string fileName = "gen.bat";

        var startInfo = new System.Diagnostics.ProcessStartInfo();
        startInfo.FileName = fileName;
        startInfo.WorkingDirectory = startPath;

        if (!File.Exists(startPath + "\\" + fileName))
        {
            Debug.LogError($"����{startPath + "\\" + fileName}�ļ��Ƿ���ڣ�·���Ƿ���ȷ!");
            return;
        }
        System.Diagnostics.Process.Start(startInfo);

        Debug.Log("Luban���ɳ��������ɹ�������뿴����̨����!");
    }
}
#endif
